Integrand size = 41, antiderivative size = 121 \[ \int (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {1}{2} a^2 (2 A+4 B+3 C) x+\frac {a^2 (2 A+B) \text {arctanh}(\sin (c+d x))}{d}-\frac {a^2 (2 A-2 B-3 C) \sin (c+d x)}{2 d}-\frac {(2 A-C) \left (a^2+a^2 \cos (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {A (a+a \cos (c+d x))^2 \tan (c+d x)}{d} \]
[Out]
Time = 0.43 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {3122, 3055, 3047, 3102, 2814, 3855} \[ \int (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {a^2 (2 A+B) \text {arctanh}(\sin (c+d x))}{d}-\frac {a^2 (2 A-2 B-3 C) \sin (c+d x)}{2 d}+\frac {1}{2} a^2 x (2 A+4 B+3 C)-\frac {(2 A-C) \sin (c+d x) \left (a^2 \cos (c+d x)+a^2\right )}{2 d}+\frac {A \tan (c+d x) (a \cos (c+d x)+a)^2}{d} \]
[In]
[Out]
Rule 2814
Rule 3047
Rule 3055
Rule 3102
Rule 3122
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \frac {A (a+a \cos (c+d x))^2 \tan (c+d x)}{d}+\frac {\int (a+a \cos (c+d x))^2 (a (2 A+B)-a (2 A-C) \cos (c+d x)) \sec (c+d x) \, dx}{a} \\ & = -\frac {(2 A-C) \left (a^2+a^2 \cos (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {A (a+a \cos (c+d x))^2 \tan (c+d x)}{d}+\frac {\int (a+a \cos (c+d x)) \left (2 a^2 (2 A+B)-a^2 (2 A-2 B-3 C) \cos (c+d x)\right ) \sec (c+d x) \, dx}{2 a} \\ & = -\frac {(2 A-C) \left (a^2+a^2 \cos (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {A (a+a \cos (c+d x))^2 \tan (c+d x)}{d}+\frac {\int \left (2 a^3 (2 A+B)+\left (2 a^3 (2 A+B)-a^3 (2 A-2 B-3 C)\right ) \cos (c+d x)-a^3 (2 A-2 B-3 C) \cos ^2(c+d x)\right ) \sec (c+d x) \, dx}{2 a} \\ & = -\frac {a^2 (2 A-2 B-3 C) \sin (c+d x)}{2 d}-\frac {(2 A-C) \left (a^2+a^2 \cos (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {A (a+a \cos (c+d x))^2 \tan (c+d x)}{d}+\frac {\int \left (2 a^3 (2 A+B)+a^3 (2 A+4 B+3 C) \cos (c+d x)\right ) \sec (c+d x) \, dx}{2 a} \\ & = \frac {1}{2} a^2 (2 A+4 B+3 C) x-\frac {a^2 (2 A-2 B-3 C) \sin (c+d x)}{2 d}-\frac {(2 A-C) \left (a^2+a^2 \cos (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {A (a+a \cos (c+d x))^2 \tan (c+d x)}{d}+\left (a^2 (2 A+B)\right ) \int \sec (c+d x) \, dx \\ & = \frac {1}{2} a^2 (2 A+4 B+3 C) x+\frac {a^2 (2 A+B) \text {arctanh}(\sin (c+d x))}{d}-\frac {a^2 (2 A-2 B-3 C) \sin (c+d x)}{2 d}-\frac {(2 A-C) \left (a^2+a^2 \cos (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {A (a+a \cos (c+d x))^2 \tan (c+d x)}{d} \\ \end{align*}
Time = 3.38 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.44 \[ \int (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {a^2 \left (4 A c+8 B c+6 c C+4 A d x+8 B d x+6 C d x-8 A \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+8 A \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 (B+2 C) \sin (c+d x)+C \sin (2 (c+d x))+4 A \tan (c+d x)\right )}{4 d} \]
[In]
[Out]
Time = 5.51 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.02
method | result | size |
parts | \(\frac {a^{2} A \tan \left (d x +c \right )}{d}+\frac {\left (2 A \,a^{2}+B \,a^{2}\right ) \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {\left (B \,a^{2}+2 a^{2} C \right ) \sin \left (d x +c \right )}{d}+\frac {\left (A \,a^{2}+2 B \,a^{2}+a^{2} C \right ) \left (d x +c \right )}{d}+\frac {a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(124\) |
parallelrisch | \(-\frac {2 \left (\cos \left (d x +c \right ) \left (A +\frac {B}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\cos \left (d x +c \right ) \left (A +\frac {B}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\left (-\frac {B}{4}-\frac {C}{2}\right ) \sin \left (2 d x +2 c \right )-\frac {\sin \left (3 d x +3 c \right ) C}{16}-\frac {x d \left (A +2 B +\frac {3 C}{2}\right ) \cos \left (d x +c \right )}{2}-\frac {\sin \left (d x +c \right ) \left (A +\frac {C}{8}\right )}{2}\right ) a^{2}}{d \cos \left (d x +c \right )}\) | \(127\) |
derivativedivides | \(\frac {A \,a^{2} \left (d x +c \right )+B \sin \left (d x +c \right ) a^{2}+a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 A \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 B \,a^{2} \left (d x +c \right )+2 a^{2} C \sin \left (d x +c \right )+A \,a^{2} \tan \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} C \left (d x +c \right )}{d}\) | \(137\) |
default | \(\frac {A \,a^{2} \left (d x +c \right )+B \sin \left (d x +c \right ) a^{2}+a^{2} C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+2 A \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 B \,a^{2} \left (d x +c \right )+2 a^{2} C \sin \left (d x +c \right )+A \,a^{2} \tan \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{2} C \left (d x +c \right )}{d}\) | \(137\) |
risch | \(a^{2} x A +2 a^{2} B x +\frac {3 a^{2} C x}{2}-\frac {i a^{2} C \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} B \,a^{2}}{2 d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} a^{2} C}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B \,a^{2}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a^{2} C}{d}+\frac {i a^{2} C \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {2 i A \,a^{2}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 A \,a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}+\frac {2 A \,a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}\) | \(246\) |
norman | \(\frac {\left (-A \,a^{2}-2 B \,a^{2}-\frac {3}{2} a^{2} C \right ) x +\left (-3 A \,a^{2}-6 B \,a^{2}-\frac {9}{2} a^{2} C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (A \,a^{2}+2 B \,a^{2}+\frac {3}{2} a^{2} C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 A \,a^{2}+6 B \,a^{2}+\frac {9}{2} a^{2} C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 A \,a^{2}-4 B \,a^{2}-3 a^{2} C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (2 A \,a^{2}+4 B \,a^{2}+3 a^{2} C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {2 a^{2} \left (6 A -C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{2} \left (2 A -2 B -3 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{2} \left (2 A -B -2 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a^{2} \left (2 A +B +2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{2} \left (2 A +2 B +5 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a^{2} \left (2 A +B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a^{2} \left (2 A +B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(401\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.07 \[ \int (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {{\left (2 \, A + 4 \, B + 3 \, C\right )} a^{2} d x \cos \left (d x + c\right ) + {\left (2 \, A + B\right )} a^{2} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, A + B\right )} a^{2} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (C a^{2} \cos \left (d x + c\right )^{2} + 2 \, {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) + 2 \, A a^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]
[In]
[Out]
\[ \int (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=a^{2} \left (\int A \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 A \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int A \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 B \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int B \cos ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 C \cos ^{3}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int C \cos ^{4}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx\right ) \]
[In]
[Out]
none
Time = 0.21 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.25 \[ \int (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {4 \, {\left (d x + c\right )} A a^{2} + 8 \, {\left (d x + c\right )} B a^{2} + {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a^{2} + 4 \, {\left (d x + c\right )} C a^{2} + 4 \, A a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, B a^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, B a^{2} \sin \left (d x + c\right ) + 8 \, C a^{2} \sin \left (d x + c\right ) + 4 \, A a^{2} \tan \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
none
Time = 0.37 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.64 \[ \int (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=-\frac {\frac {4 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1} - {\left (2 \, A a^{2} + 4 \, B a^{2} + 3 \, C a^{2}\right )} {\left (d x + c\right )} - 2 \, {\left (2 \, A a^{2} + B a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) + 2 \, {\left (2 \, A a^{2} + B a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 3 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 1.95 (sec) , antiderivative size = 232, normalized size of antiderivative = 1.92 \[ \int (a+a \cos (c+d x))^2 \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx=\frac {2\,A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+4\,B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+3\,C\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )-A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,4{}\mathrm {i}-B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}+\frac {\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2}+C\,a^2\,\sin \left (2\,c+2\,d\,x\right )+\frac {C\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{8}+A\,a^2\,\sin \left (c+d\,x\right )+\frac {C\,a^2\,\sin \left (c+d\,x\right )}{8}}{d\,\cos \left (c+d\,x\right )} \]
[In]
[Out]